
const{Service}=require('egg');

class ArticleService extends Service{
    async show({id}){//获取文章详情
        // console.log(666,id)
        const sql=`select * from article where id='${id}'`;
        return await this.app.mysql.query(sql);
    }
    async index(){//获取文章列表
        const sql=`select * from article`;
        return await this.app.mysql.query(sql);
    }
};

module.exports=ArticleService;